﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="Accounts.aspx.cs" Inherits="User_Accounts" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
<br/>
 <asp:HyperLink ID="UserLink" runat="server" NavigateUrl="UserPanel.aspx">Панель пользователя</asp:HyperLink>
&nbsp;<span class="Apple-style-span" 
        style="color: rgb(105, 105, 105); font-family: 'Helvetica Neue', 'Lucida Grande', 'Segoe UI', Arial, Helvetica, Verdana, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); display: inline !important; float: none; ">→&nbsp; </span> 
  
    <b><asp:Label ID="UserLabel" runat="server" Text="Счета" ForeColor="black"></asp:Label></b><br/><br/>
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
        DataKeyNames="Номер счёта" DataSourceID="SqlDataSourceBankAccounts" 
        onrowdatabound="GridView1_RowDataBound">
        <Columns>
            <asp:BoundField DataField="Номер счёта" HeaderText="Номер счёта" 
                InsertVisible="False" ReadOnly="True" SortExpression="Номер счёта" />
            <asp:BoundField DataField="Сумма" HeaderText="Сумма" SortExpression="Сумма" />
            <asp:BoundField DataField="Валюта" HeaderText="Валюта" 
                SortExpression="Валюта" />
                <asp:TemplateField>
                            <ItemTemplate>
                                <asp:LinkButton ID="TransferLink" runat="server" OnClick="TransferClicked">Перевести на другой счёт</asp:LinkButton>
                            </ItemTemplate>
                            </asp:TemplateField>
        </Columns>
        <EmptyDataTemplate>
            Счетов нет.
        </EmptyDataTemplate>
    </asp:GridView>

    <asp:SqlDataSource ID="SqlDataSourceBankAccounts" runat="server" 
        ConnectionString="<%$ ConnectionStrings:DatabaseConnectionString %>" 
        SelectCommand="SELECT BankAccount.BankAccountId AS [Номер счёта], BankAccount.Amount AS Сумма, Currency.Name AS Валюта FROM BankAccountCompany INNER JOIN BankAccount ON BankAccountCompany.BankAccountId = BankAccount.BankAccountId INNER JOIN Currency ON BankAccount.CurrencyId = Currency.CurrencyID INNER JOIN Company ON BankAccountCompany.CompanyId = Company.CompanyId INNER JOIN UserProfile ON Company.CompanyId = UserProfile.CompanyId WHERE (UserProfile.ProfileId = @profileId)">
        <SelectParameters>
            <asp:Parameter Name="profileId" />
        </SelectParameters>
    </asp:SqlDataSource>

</asp:Content>

